package org.charles.zhifou.model.dto.question;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 获取题目列表请求
 *
 * @author Charles
 * @version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuestionContentDTO implements Serializable {

    @Schema(description = "题目标题")
    @Length(min = 1, max = 256, message = "题目标题不能为空且长度不能超过 256 个字符")
    private String title;

    @Schema(description = "题目选项列表")
    @NotNull(message = "题目选项不能为空")
    private List<Option> options;

    @Schema(description = "题目选项")
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Option implements Serializable {
        private String result;
        private int score;
        private String value;
        private String key;

        @Serial
        private static final long serialVersionUID = 1L;
    }

    @Serial
    private static final long serialVersionUID = 1L;
}


